Crate frame_support

source ·
Expand description

Support code for the runtime.

Note on Tuple Traits

Many of the traits defined in traits have auto-implementations on tuples as well. Usually, the tuple is a function of number of pallets in the runtime. By default, the traits are implemented for tuples of up to 64 items.

Re-exports

Modules

  • Utilities for dealing with crypto primitives. Sometimes we need to use these from inside WASM contracts, where crypto calculations have weak performance.
  • Dispatch system. Contains a macro for defining runtime modules and generating values representing lazy module function calls.
  • Provides functions to interact with the dispatch context.
  • Macro for declaring a module error.
  • Macros that define an Event types. Events can be used to easily report changes or conditions in your runtime to external entities like users, chain explorers, or dApps.
  • Some instance placeholder to be used in frame_support::pallet attribute macro.
  • Intermediate representation of the runtime metadata.
  • Contains macro stubs for all of the pallet:: macros
  • Prelude to be used alongside pallet macro, for ease of use.
  • Stuff to do with the runtime’s storage.
  • Traits and associated utilities for use in the FRAME environment.
  • Re-exports sp-weights public API, and contains benchmarked weight constants specific to FRAME.

Macros

  • Assert an expression returns an error specified.
  • Assert an expression returns an error specified.
  • Assert an expression returns error with the given weight.
  • Assert that the maximum encoding size does not exceed the value defined in MAX_MODULE_ERROR_ENCODED_SIZE during compilation.
  • Evaluate an expression, assert it returns an expected Err value and that runtime storage has not been mutated (i.e. expression is a no-operation).
  • Panic if an expression doesn’t evaluate to Ok.
  • Evaluate any expression and assert that runtime storage has not been mutated (i.e. expression is a storage no-operation).
  • Construct a runtime, with the given name and the given pallets.
  • Convert the current crate version into a CrateVersion.
  • Declare an error type for a runtime module.
  • Implement the Event for a module.
  • Declares a Module struct and a Call enum, which implements the dispatch logic.
  • Declares strongly-typed wrappers around codec-compatible types in storage.
  • Generic function to mark an execution path as ONLY defensive.
  • Trigger a defensive failure if a condition is not met.
  • Evaluate $x:expr and if not true return Err($y:expr).
  • Return Err of the expression: return Err($expression);.
  • Macro that inserts some tokens after the first match of some pattern.
  • match_typeDeprecated
    Create a type which implements the Contains trait for a particular type with syntax similar to matches!.
  • Create a type which implements the Contains trait for a particular type with syntax similar to matches!.
  • Macro for easily creating a new implementation of both the Get and Contains traits. Use exactly as with parameter_types, only the type must be Ord.
  • Create new implementations of the Get trait.
  • Print out a formatted message.
  • Enable/disable the given code depending on feature = "std" being enabled for the crate or not.

Structs

Enums

  • A type that cannot be instantiated.
  • The void type - it cannot exist.

Constants

Traits

Functions

  • Print out the debuggable type.
  • Print something that implements Printable from the runtime.

Type Definitions

Attribute Macros

Derive Macros